import React, { useState } from 'react'
import { ResultPage, Card, Toast } from 'antd-mobile'
import style from '../index/index.module.css'
import { Input } from 'antd-mobile'
import { useNavigate } from 'react-router-dom'
import { LoopOutline } from 'antd-mobile-icons'
import { Button, Space } from 'antd-mobile'
function Index() {
    const navigate=useNavigate();
    const [start,setStart]=useState('');
    const [end,setEnd]=useState('')

    const goList=()=>{
        navigate(`/list?start=${start}&end=${end}`)
    }
  return (
    <div>
      <ResultPage
      status='success'
      title='操作成功'
      description='内容详情可折行，建议不超过两行建议不超过两行建议不超过两行'
    >
      

      <Card style={{ height: 128, marginTop: 12 }}>
        <div className={style.hezi}>

             <Input
          placeholder='请输入起点'
          value={start}
          onChange={val => {
            setStart(val)
          }}
        />

        <span> <LoopOutline /> </span>


         <Input
          placeholder='请输入目的地'
          value={end}
          onChange={val => {
            setEnd(val)
          }}
        />

        </div>
      </Card>

       <Button onClick={goList} block color='primary' size='large'>
          搜索
        </Button>
    </ResultPage>
    </div>
  )
}

export default Index
